package com.ruoyi.train.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.train.mapper.ETrainRecordMapper;
import com.ruoyi.common.core.domain.e_train.ETrainRecord;
import com.ruoyi.train.service.IETrainRecordService;

/**
 * 培训人员Service业务层处理
 * 
 * @author JYW
 * @date 2024-01-30
 */
@Service
public class ETrainRecordServiceImpl implements IETrainRecordService 
{
    @Autowired
    private ETrainRecordMapper eTrainRecordMapper;

    /**
     * 查询培训人员
     * 
     * @param id 培训人员主键
     * @return 培训人员
     */
    @Override
    public ETrainRecord selectETrainRecordById(Long id)
    {
        return eTrainRecordMapper.selectETrainRecordById(id);
    }

    /**
     * 查询培训人员列表
     * 
     * @param eTrainRecord 培训人员
     * @return 培训人员
     */
    @Override
    public List<ETrainRecord> selectETrainRecordList(ETrainRecord eTrainRecord)
    {
        return eTrainRecordMapper.selectETrainRecordList(eTrainRecord);
    }

    /**
     * 新增培训人员
     * 
     * @param eTrainRecord 培训人员
     * @return 结果
     */
    @Override
    public int insertETrainRecord(ETrainRecord eTrainRecord)
    {
        eTrainRecord.setCreateTime(DateUtils.getNowDate());
        return eTrainRecordMapper.insertETrainRecord(eTrainRecord);
    }

    /**
     * 修改培训人员
     * 
     * @param eTrainRecord 培训人员
     * @return 结果
     */
    @Override
    public int updateETrainRecord(ETrainRecord eTrainRecord)
    {
        eTrainRecord.setUpdateTime(DateUtils.getNowDate());
        return eTrainRecordMapper.updateETrainRecord(eTrainRecord);
    }

    /**
     * 批量删除培训人员
     * 
     * @param ids 需要删除的培训人员主键
     * @return 结果
     */
    @Override
    public int deleteETrainRecordByIds(Long[] ids)
    {
        return eTrainRecordMapper.deleteETrainRecordByIds(ids);
    }

    /**
     * 删除培训人员信息
     * 
     * @param id 培训人员主键
     * @return 结果
     */
    @Override
    public int deleteETrainRecordById(Long id)
    {
        return eTrainRecordMapper.deleteETrainRecordById(id);
    }
}
